# -*- coding: UTF-8 -*-
# @Time : 2021/12/9 0009 15:32
# @Author : lyw
# @Remark : 精密空调View
from mxsoftpy import View
from index import _
from server.common.IOTManager.AirConditioner.air_conditioner import (PrecisionACSelectServer, ACListServer,
                                                                     ACRetrieveServer)
from utils.public.params_method import check_params


class ACSelectView(View):

    def post(self):
        return _("查询成功"), PrecisionACSelectServer().select(**self.request.POST)


class ACListView(View):

    @staticmethod
    def post():
        return _("查询成功"), ACListServer().list()


class ACRetrieveView(View):

    def post(self):
        check_params(self.request.POST, ["ac_code"])
        return _("查询成功"), ACRetrieveServer().retrieve(self.request.POST["ac_code"])
